package com.ruoyi.project.WebMoudle.userPick.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.project.WebMoudle.shopPick.domain.PickSum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.WebMoudle.userPick.mapper.UserPickMapper;
import com.ruoyi.project.WebMoudle.userPick.domain.UserPick;
import com.ruoyi.project.WebMoudle.userPick.service.IUserPickService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 用户提现Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-07-20
 */
@Service
public class UserPickServiceImpl implements IUserPickService 
{
    @Autowired
    private UserPickMapper userPickMapper;

    /**
     * 查询用户提现
     * 
     * @param orderNum 用户提现ID
     * @return 用户提现
     */
    @Override
    public UserPick selectUserPickById(String orderNum)
    {
        return userPickMapper.selectUserPickById(orderNum);
    }

    /**
     * 查询用户提现列表
     * 
     * @param userPick 用户提现
     * @return 用户提现
     */
    @Override
    public List<UserPick> selectUserPickList(UserPick userPick)
    {
        return userPickMapper.selectUserPickList(userPick);
    }

    /**
     * 新增用户提现
     * 
     * @param userPick 用户提现
     * @return 结果
     */
    @Override
    public int insertUserPick(UserPick userPick)
    {
        userPick.setCreateTime(DateUtils.getNowDate());
        return userPickMapper.insertUserPick(userPick);
    }

    /**
     * 修改用户提现
     * 
     * @param userPick 用户提现
     * @return 结果
     */
    @Override
    public int updateUserPick(UserPick userPick)
    {
        return userPickMapper.updateUserPick(userPick);
    }

    /**
     * 删除用户提现对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteUserPickByIds(String ids)
    {
        return userPickMapper.deleteUserPickByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除用户提现信息
     * 
     * @param orderNum 用户提现ID
     * @return 结果
     */
    @Override
    public int deleteUserPickById(String orderNum)
    {
        return userPickMapper.deleteUserPickById(orderNum);
    }

    @Override
    public List<UserPick> queryMonthLog(Long wxUserId, String month) {
        return userPickMapper.queryMonthLog(wxUserId,month);
    }

    @Override
    public PickSum queryMoneySum(UserPick userPick) {
        return userPickMapper.queryMoneySum(userPick);
    }
}
